<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户评价</title>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>
    <script type="text/javascript" src="/layui/rate.js"></script>
    <link rel="stylesheet" href="/layui-v2.5.7/layui/css/layui.css"  media="all">
    <script src="/layui-v2.5.7/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="/new/css/index/photoswipe.css"/>
    <link rel="stylesheet" type="text/css" href="/new/css/index/style.css"/>
    <link rel="stylesheet" type="text/css" href="/new/css/index/responsive.css"/>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
    <script src="/new/js/index/jquery.min.js"></script>

</head>
<body>

<span style="font-size: x-large">用户评价<b></b></span><i style="font-size: medium">Evaluate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i><span  style="font-size: larger;color:#ff7800;" th:text="${score}" id="scoreAvg"></span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="avg"></span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="layui-btn" onclick="x_admin_show('我要评论','/evaluate/add')">我要评价</button>
<hr class="layui-bg-blue">
<table class="layui-table" lay-even="" lay-skin="nob" th:each="x:${list}">
    <colgroup>
        <col width="150">
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <tbody>
    <tr>
        <td>
            <ul class="list-group list-group-flush">
                <li class="list-group-item">
                    <div >
                        <span th:text="${x.user.userName}" style="font-size: 15px"></span>
                        <span>&nbsp;</span>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <span th:text="${x.evaluateTime}" style="color: grey; font-size: 14px"></span>
                    </div>
                    <div>
                        <span th:text="${x.evaluateStar}" style="color: grey; font-size: 14px" id="evaluateStar"></span>分&nbsp;&nbsp;&nbsp;<span>
                            <div th:evaluateStar="${x.evaluateStar}" name="star"></div>
                    </span>
                    </div>

                    <span></span>
                     <div>
                         <span style="font-size: 20px" th:text="${x.evaluateContent}"></span><span>&nbsp;</span>
                     </div>
                    <hr class="layui-bg-blue">
                </li>
            </ul>
        </td>
    </tr>

    </tbody>
</table>
<div class="page">
    <div>
        <a class="prev" th:href="@{/evaluate/pj(page=${prePage})}">&lt;&lt;</a>
        <a class="num" href="/evaluate/pj">首页</a>
        <span class="current" th:text="${curPage}"></span>
        <a class="num" th:href="@{/evaluate/pj(page=${totalPages})}">尾页</a>
        <a class="next" th:href="@{/evaluate/pj(page=${nextPage})}">&gt;&gt;</a>
<!--        到第<input id="jump" type="text" class="input03" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> 页-->
<!--        <input onclick="jump();" type="button" value="确定" class="input04">-->
    </div>
</div>
<script src="/new/js/index/plugin.js"></script>
<script src="/new/js/index/page.js"></script>
<script src="/new/js/index/buttonLite.js"></script>
</body>
</html>
<script>
    //遍历
    layui.use(['rate'], function(){
        var rate = layui.rate;
        $.each($("[name=star]"), function (i, item) {
            rate.render({
                elem: item
                ,value: parseInt($(item).attr("evaluateStar"))
                ,half:true
                ,readonly: true
            });
        });
    });
// ----------------------------------------
    var scoreAvg = $("#scoreAvg").html();
    layui.use(['rate'], function(){
        var rate = layui.rate;
    //只读
    rate.render({
        elem: '#avg'
        ,value: scoreAvg
        ,readonly: true
        ,half:true
    });
    });
</script>